// 基于template/src/views/{{appModules}}/{{pages@DECUSTOMVIEW}}/{{spinalCase page.codeName}}-hook.ts.hbs生成
import { QXEvent } from 'qx-util';
import {
	CustomViewActionType,
	CustomViewController,
	ICustomViewAbility,
	ICustomViewControllerParams,
	IParam,
	IViewEvent,
} from '@/core';
import {
	useCustomViewProps,
	useCustomViewBasic,
	useCustomViewControllerParams,
    useCustomViewAction,
} from '@/hooks/view/use-custom-view';
import { model } from "./ibiz-custom-usr-0306906704-custom-view-model";

/**
 * 获取输入参数
 *
 * @export
 * @return {*}
 */
export function useProps() {
	return {
		...useCustomViewProps()
	};
}

/**
 * 获取基础数据
 *
 * @export
 * @param {*} props
 * @return {*}
 */
export function useBasic(props: any) {
	return {
		...useCustomViewBasic(model, props)
	};
}

/**
 * 获取行为
 *
 * @export
 */
export function useAction(controller: any) {
	return {
        ...useCustomViewAction(controller)
    }
}

/**
 * 获取控制器
 *
 * @export
 * @param {IParam} props
 * @param {QXEvent<IViewEvent<CustomViewActionType, ICustomViewAbility>>} evt
 * @return {*}
 */
export function useController(
	props: IParam,
	evt: QXEvent<IViewEvent<CustomViewActionType, ICustomViewAbility>>
) {
	const params: ICustomViewControllerParams<
		CustomViewActionType,
		ICustomViewAbility
	> = useCustomViewControllerParams(model, props, evt);
	return new CustomViewController(params);
}